package com.demo.task.ext

import com.demo.task.MainApplication

private val context = MainApplication.instance

fun getResPath(): String {
    val res = context.getExternalFilesDir("res")
    if (res?.exists() == true) {
        res.listFiles()?.forEach { it.delete() }
        res.mkdirs()
    }
    return context.getExternalFilesDir("playsource")?.path.orEmpty()
}

fun getExternalFilesDir(type: String? = null): String {
    return context.getExternalFilesDir(type)?.path.orEmpty()
}